package cn.wolfcode.luowowo.search.service.impl;

import cn.wolfcode.luowowo.search.domain.TravelTemplate;
import cn.wolfcode.luowowo.search.domain.UserInfoTemplate;
import cn.wolfcode.luowowo.search.qo.IndexSearchQo;
import cn.wolfcode.luowowo.search.repository.IUserInfoSearchRepository;
import cn.wolfcode.luowowo.search.service.ISearchService;
import cn.wolfcode.luowowo.search.service.IUserInfoSearchService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;

@Service
public class UserInfoSearchServiceImpl implements IUserInfoSearchService {

    @Autowired
    private IUserInfoSearchRepository repository;
    @Autowired
    private ISearchService searchService;

    @Override
    public void save(UserInfoTemplate template) {
        repository.save(template);
    }

    @Override
    public Page queryWithHighlight(IndexSearchQo qo) {

        return searchService.searchWithHighlight(qo.getIndex(),qo.getTrueType(), UserInfoTemplate.class,qo,"nickname","destName");
    }
}
